$dark: #282c34;

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: $dark;
}

* {
  box-sizing: border-box;
}

.main-header {
  padding: 0 20px;
  height: 50px;
  line-height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background-color: $dark;

  &-right {
    display: flex;
    align-items: center;
  }

  &-search {
    line-height: initial;
    margin-right: 1em;
  }

  h1 {
    margin: 0;
    font-size: 16px;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.1em;

    a {
      color: lighten($dark, 50%);
      text-decoration: none;
    }

    strong {
      font-weight: bold;
      color: #fff;
    }
  }

  ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  li {
    display: inline-block;

    + li {
      margin-left: 20px;
    }

    a {
      color: #fff;
      font-size: 12px;
      text-decoration: none;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
  }
}

.intro {
  margin-top: 25px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  text-align: center;

  h1 {
    margin-top: 0;
    margin-bottom: 1em;
  }
}

.cta {
  padding: 10px;
  text-decoration: none;
  color: #fff;
  background-color: $dark;
  border-radius: 3px;
}

.wrapper {
  padding-top: 50px;
  display: flex;
  min-height: 100vh;
}

.widgets-list {
  padding: 0 20px 20px;
  display: inline-block;
  vertical-align: top;
  background-color: #eee;
  border-right: 1px solid #ddd;
  width: 300px;

  ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  li + li {
    margin-top: 5px;
  }

  a {
    color: $dark;
  }
}

.widgets-details {
  padding-bottom: 20px;
  display: inline-block;
  vertical-align: top;
  width: calc(100% - 300px);

  > * {
    margin-left: 20px;
    margin-right: 20px;
  }

  pre {
    position: relative;
    font-size: 16px;
    color: #fff;
    background-color: $dark;

    &:before,
    &:after {
      content: '';
      position: absolute;
      top: 20px;
      bottom: 20px;
      width: 20px;
    }

    &:before {
      left: 0;
      background: linear-gradient(to left, rgba($dark, 0), rgba($dark, 1) 70%);
    }

    &:after {
      right: 0;
      background: linear-gradient(to right, rgba($dark, 0), rgba($dark, 1) 70%);
    }

    code {
      padding: 21px;
      display: block;
      overflow-x: auto;
    }
  }

  table {
    border-collapse: collapse;
    font-size: 14px;
    border: 1px solid #ccc;
    width: calc(100% - 40px);
  }

  td,
  th {
    padding: 10px;
    white-space: nowrap;
    border: 1px solid #ccc;

    &:last-of-type {
      white-space: normal;
      width: 100%;
    }
  }
}

.theme-selector {
  margin: 0;
  padding: 15px 20px;
}

.info {
  padding: 10px;
  background-color: #fcec9c;
}

.code-wrapper-tabs {
  display: flex;
}

.code-wrapper-tab {
  padding: 5px 10px;
  appearance: none;
  position: relative;
  top: 1px;
  font-size: 14px;
  border-top: 1px solid #ddd;
  border-right: 1px solid #ddd;
  border-left: 1px solid #ddd;
  border-bottom: 1px solid #eee;
  background-color: #eee;
  color: black;
  cursor: pointer;
  outline: none;
  border-radius: 0;

  &.selected {
    background-color: #fff;
    border-bottom: 1px solid #fff;
  }

  + .code-wrapper-tab {
    border-left: none;
  }
}

.code-wrapper-contents {
  padding: 20px;
  border: 1px solid #ddd;
  overflow: auto;
  transition: 0.2s background-color ease-in-out;
}

.code-output code {
  font-size: 14px;
}

.highlighted-text {
  position: relative;
  background-color: lighten($dark, 15%);

  &:after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border: 1px solid lighten($dark, 50%);
  }
}

.demo {
  flex-grow: 1;

  .ais-Breadcrumb,
  .ais-SearchBox {
    margin-bottom: 0.5rem;
  }

  .ais-Hits,
  .ais-Pagination,
  .ais-CurrentRefinements {
    margin-top: 1rem;
  }
}

.demo-container {
  padding: 20px;
  display: flex;
}

.demo-filters {
  padding-right: 20px;
  min-width: 300px;
  border-right: 1px solid #ccc;
}

.demo-results {
  padding-left: 20px;
  flex-grow: 1;
}

.demo-widget {
  + .demo-widget {
    margin-top: 30px;
  }
}

// Simulate the map
.code-wrapper-content {
  .ais-GeoSearch {
    height: 500px;
  }

  .ais-GeoSearch-map {
    background: rgb(229, 227, 223);
  }
}

.flex-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.bottom-border {
  border-bottom: 1px solid #ddd;
}

.link-button {
  color: inherit;
  text-decoration: none;
  padding: 0.4em;
  border: 1px solid #ddd;
  border-radius: 0.2em;

  &:focus {
    border: 1px solid #333;
  }

  &:active {
    border: 1px solid black;
  }
}

.dark {
  background-color: $dark;
  color: white;
}
